import {
  baiscOnlineStatusType,
  basicHomeData,
  basicMapData,
  ChargeCabinetType,
  detectionEntity,
  proportionEntity,
  TokenRequestData,
} from '@/types'

export type queryChargingStationRequestData = TokenRequestData

export interface ChargingStationPushData {
  boxId: number
  boxLoggingId: number
  category: string
  createdTime: string
  extensionData: string
  orderId: string
  remark: string
  type: string
  updatedTime: string
  userId: string
}
export interface ChargingStationFaultEntity {
  category: string
  createdTime: string
  deviceCode: string
  faultDescription: string
  faultId: number
  imageUrls: string
  latitude: number
  longtitude: number
  messageId?: any
  operationTime?: any
  operationUser?: any
  remark: string
  state: string
  updatedTime: string
  userId: number
  workOrderId?: any
}

export interface ChargingStationDataEntity extends basicMapData {
  abnormalTemperature: number
  address: string
  alarm: number
  batteryCount: number
  boxCode: string
  boxId: number
  boxLockId: string
  boxName: string
  charging: number
  contact: string
  contactPhone: string
  createdTime: string
  doorCount: number
  networkStatus: baiscOnlineStatusType
  serviceTime: string
  updatedTime: string
}

export interface queryChargingStationResponseData {
  batteryTotal: number
  boxTotal: number
  chargingStationTotal: number
  pushData: basicHomeData<ChargingStationPushData[]>
  detection: basicHomeData<detectionEntity[]>
  record: basicHomeData<ChargingStationFaultEntity[]>
  proportion: basicHomeData<proportionEntity[]>
  getRealtimeDataset: basicHomeData<string[][]>
  getTrend: basicHomeData<string[][]>
  boxDataList: ChargingStationDataEntity[]
}

export type queryChargingStationResponse = ApiResponseData<queryChargingStationResponseData>

export interface queryChargingStationDetailInfoRequestData extends TokenRequestData {
  produceId: string
}
export interface durationEntity {
  label: string
  value: number
  percent: number
}
export interface OtherBoxEntity {
  boxId: number
  boxCode: string
  boxName: string
  batteryCount: number
  charge: number
}
export interface doorDetailEntity {
  doorId: number
  charge: string
  capacity: string
  voltage: string
  current: string
  duration: string
  power: number
  doorStatus: string
  empty: boolean
}
export interface queryChargingStationDetailInfoResponseData {
  box: ChargingStationDataEntity
  duration: durationEntity[]
  otherBox: OtherBoxEntity[]
  doorDetail: doorDetailEntity[]
}

export type queryChargingStationDetailInfoResponse =
  ApiResponseData<queryChargingStationDetailInfoResponseData>

export interface queryChargingStationDetectionRequestData extends TokenRequestData {
  type: ChargeCabinetType
}

export type queryChargingStationDetectionResponseData = ChargingStationDataEntity

export type queryChargingStationDetectionResponse = ApiResponseData<
  queryChargingStationDetectionResponseData[]
>
